# 导包 多点触碰操作包 MultiAction，连续滑动操作包 TouchAction
from appium.webdriver.common.touch_action import TouchAction
from appium.webdriver.common.multi_action import MultiAction

# 实例化对象

# 移动坐标
def smaller(driver):
    x = driver.get_window_size()['width']
    y = driver.get_window_size()['height']
    t1 = TouchAction(driver)
    t2 = TouchAction(driver)
    t1.press(x=x * 0.2, y=y * 0.2).wait(1000).move_to(x=x*0.4,y=y*0.4).wait(1000).release()
    t2.press(x=x * 0.7, y=y * 0.7).wait(1000).move_to(x=x*0.5,y=y*0.5).wait(1000).release()

    m = MultiAction(driver)
    m.add(t1,t2)
    m.perform()
def bigger(driver):
    x = driver.get_window_size()['width']
    y = driver.get_window_size()['height']
    t1 = TouchAction(driver)
    t2 = TouchAction(driver)
    t1.press(x=x * 0.4, y=y * 0.4).wait(1000).move_to(x=x * 0.2, y=y * 0.2).wait(1000).release()
    t2.press(x=x * 0.6, y=y * 0.6).wait(1000).move_to(x=x * 0.8, y=y * 0.8).wait(1000).release()

    m = MultiAction(driver)
    m.add(t1, t2)
    m.perform()
